<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <ul id="tesTest">
        <li><p>123<div>234</div></p></li>
        <li>1</li><br>
        <li>1</li>
        <li>1</li>
    </ul>
    ------------------------------------<br>
    事件委托<br>
    <ul id="number">
        <li>1<button>删除</button></li>
        <li>2<button>删除</button></li>
        <li>3<button>删除</button></li>
        <li>4<button>删除</button></li>
        <li>5<button>删除</button></li>
        <li>6<button>删除</button></li>
        <li>7<button>删除</button></li>
        <li>8<button>删除</button></li>
        <li>9<button>删除</button></li>
    </ul>
</head>
<body>
<p id="ppp">HeiHei</p>

<script>
    var Person = function () {
        this.name = 'gang'
    };
    Person.prototype.sayName = function () {
        console.log(this.name)
    };
    Person.prototype.sayHello = function () {
        console.log('Hello')
    };
    (new Person()).sayHello();

    var Gang = function () {
        this.age = 20;
    };

    Gang.prototype = new Person();
    var gang = new Gang();
    gang.sayName();

    Gang.prototype.sayHello = function () {
        console.log('Hello Gang');
    };

    gang.sayHello();


    function testParm(value1, value2) {
        console.group(value1)
        console.time("Array initialize")
        console.log('123')
        console.log("Node count:", this.childNodes, "and the current time is:", Date.now());
        console.assert(this.childNodes < 500, "Node count is > 500");
        console.log("%s has %d points", "Sam", 100);
        console.log("%cThis will be formatted with large, blue text", "color: blue; font-size: x-large");
        console.dir(this)
        console.table([{a: 1, b: 2, c: 3}, {a: "foo", b: false, c: undefined}]);
        console.table([[1, 2, 3], [2, 3, 4]]);

        function Person(firstName, lastName, age) {
            this.firstName = firstName;
            this.lastName = lastName;
            this.age = age;
        }

        var List={
            _array:[],
            set new(value){
                this._array.push(value)
            },
            get last(){
                return this._array[0]
            },
            get value(){
                return this._array
            }
        }




        // class Animal {
        //     constructor(family, specie, hue) {
        //         this.family = family
        //         this.specie = specie
        //         this.hue = hue
        //
        //         yell()
        //         {
        //             console.log(this.hue)
        //         }
        //     }
        // }

        var family = {};
        family.mother = new Person("Susan", "Doyle", 32);
        family.father = new Person("John", "Doyle", 33);
        family.daughter = new Person("Lily", "Doyle", 5);
        family.son = new Person("Mike", "Doyle", 8);
        console.table(family, ["firstName", "lastName", "age"]);
        List.new=1
        List.new=2
        List.new=3
        var myList=[]
        console.error(document.getElementById('ppp').length)
        console.log('childNodes',document.getElementById('tesTest').childNodes)
        var getFirstChild = document.getElementById("tesTest").children[0];
        console.log('children[0]',getFirstChild)
        console.log('firstChild',document.getElementById("tesTest").firstChild)
        console.log('firstElementChild',document.getElementById("tesTest").firstElementChild)
        console.log('lastChild',document.getElementById("tesTest").lastChild)
        console.log('lastElementChild',document.getElementById("tesTest").lastElementChild)
        console.log(List.last)     //=>1
        console.log(List.value)    //=>[1,2,3]
        console.timeEnd("Array initialize")
        // for (var i = 0; i < 1000; i++) {
        //     console.count()
        // }

        console.groupEnd(value2)
    }

    testParm('i love gang')

    var ul= document.getElementById('number')
    console.error(ul)
</script>
</body>
</html>
